package cn.wsalix.templet.service.impl;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.anlaser.service.impl.SimpleServiceImpl;
import cn.anlaser.utils.SearchFilter;
import cn.wsalix.templet.entity.TempletPagePlace;
import cn.wsalix.templet.form.TempletPagePlaceForm;
import cn.wsalix.templet.repository.TempletPagePlaceRepository;
import cn.wsalix.templet.service.TempletPagePlaceService;

@Service("templetPlaceService")
@Transactional(readOnly = true)
public class TempletPlaceServiceImpl
		extends
		SimpleServiceImpl<TempletPagePlaceForm, TempletPagePlaceRepository, TempletPagePlace>
		implements TempletPagePlaceService {

	@Autowired
	private TempletPagePlaceRepository templetPlaceRepository;

	@Autowired
	private TempletPagePlaceRepository templetPagePlaceRepository;

	@Override
	public TempletPagePlaceRepository getRepository() {
		return templetPlaceRepository;
	}

	@Override
	public String module() {
		return "templetplace";
	}

	@Override
	public TempletPagePlace findByPlaceCode(String placeCode) {
		return templetPlaceRepository.findByPlaceCodeOne(placeCode);
	}

	@Transactional
	@Override
	public void savePagePlace(TempletPagePlace templetPagePlace) {
		templetPagePlaceRepository.save(templetPagePlace);
	}

	@Override
	public Class<TempletPagePlace> getEntityClazz() {
		return TempletPagePlace.class;
	}

	@Override
	public Map<String, SearchFilter> buildByForm(TempletPagePlaceForm form) {
		// TODO Auto-generated method stub
		return null;
	}

}
